
<%
	Connection con = null;
	Statement ps = null;
	ResultSet rs = null;

	String QUERY_SELECT_AUTO_ANYL_POLL = SqlFactory.getQuery(
			"AutoAnylPoll", "QUERY_SELECT_AUTO_ANYL_POLL");
	String m_sQUERY_AUTO_ANYL_POLL_DEFAULT1 = SqlFactory.getQuery(
			"AutoAnylPoll", "m_sQUERY_AUTO_ANYL_POLL_DEFAULT1");
	String m_sQUERY_AUTO_ANYL_POLL_DEFAULT2 = SqlFactory.getQuery(
			"AutoAnylPoll", "m_sQUERY_AUTO_ANYL_POLL_DEFAULT2");


	//actionForm.setTest_mail_id(sMailID);		
	Properties loginInfo = getLoginInfo(req);
	String sUserID = loginInfo.getProperty("USER_ID");
	String sUserType = loginInfo.getProperty("USER_GRADE1");
	String sUserName = loginInfo.getProperty("USER_NAME");
	String sUserDept = loginInfo.getProperty("USER_DEPT");
	String sUserDeptName = loginInfo.getProperty("EMPDEPTNAME");
	// End

	/// Query 실행 관련 변수
	Properties SQL_PARAM = new Properties();
	Properties SQL_RESULT = new Properties();
	SqlComposer SQL_COMPOSER = SqlComposer.getInstance();



	//SQL_PARAM.setProperty("USER_ID", sUserID);
	//SQL_PARAM.setProperty("MAIL_ID", mail_id);

	String startdate = request.getParameter("startdate");
	String enddate = request.getParameter("enddate");
	SQL_COMPOSER.addCondition(SqlComposer.CONDITION_AND, m_sQUERY_AUTO_ANYL_POLL_DEFAULT1);
	SQL_PARAM.setProperty("START_DATE", startdate);
	SQL_COMPOSER.addCondition(SqlComposer.CONDITION_AND, m_sQUERY_AUTO_ANYL_POLL_DEFAULT2);
	SQL_PARAM.setProperty("END_DATE", enddate);


	SQL_PARAM.setProperty("JOIN_TABLE",", EMS_AUTO_SCHEDULE_INFO B");
	SQL_COMPOSER.addCondition(SqlComposer.CONDITION_AND, m_sQUERY_AUTO_ANYL_POLL_SUB1);

	SQL_COMPOSER.addGroupBy("A.WORKDAY");
	SQL_COMPOSER.addOrderBy(SqlComposer.ORDER_ASC, "A.WORKDAY");
	

	
	
	
	
	try {
		String sQuery_PollList = StringUtil.parseSQL( SQL_COMPOSER.getQuery( QUERY_SELECT_AUTO_ANYL_POLL , SqlComposer.EXEC_LIST_SELECT ) ,SQL_PARAM );

		con = ConnectionFactory.getConnection();
		ps = con.createStatement();

		ArrayList result = new ArrayList();
		DBUtil.executeQuery(con,
				StringUtil.parseSQL(sQuery_PollList, SQL_PARAM),
				result, new AutoAnylPoll0Bean());
	} catch (Exception e) {
		Log.error(e.toString());
	} finally {
		DBUtil.release(rs);
		DBUtil.release(ps);
		DBUtil.release(con);
	}
%>